package com.mindskip.xzs.repository;

import com.mindskip.xzs.domain.dto.KeyValue;
import com.mindskip.xzs.domain.dto.student.exampaper.ExamPaperAnswerUpdate;
import com.mindskip.xzs.domain.dto.student.qusetion.QuestionPageStudentDTO;
import com.mindskip.xzs.domain.entity.ExamPaperQuestionCustomerAnswer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface ExamPaperQuestionCustomerAnswerMapper extends BaseMapper<ExamPaperQuestionCustomerAnswer> {

    // 查询表中每行信息的总数
    Integer selectAllCount();

    // 查询当前月份从月初到今天每天的答题数量，key存储着日期，value存储着相对应的答题数量
    List<KeyValue> selectCountByDate(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    // 批量插入
    int insertBatch(List<ExamPaperQuestionCustomerAnswer> examPaperQuestionCustomerAnswers);

    List<ExamPaperQuestionCustomerAnswer> selectByExamPaperAnswerId(Integer examPaperAnswerId);

    int updateScore(List<ExamPaperAnswerUpdate> examPaperAnswerUpdates);

    List<ExamPaperQuestionCustomerAnswer> selectByPageStudent(QuestionPageStudentDTO questionPageStudentDTO);
}
